/*
Navicat MySQL Data Transfer

Source Server         : root
Source Server Version : 50711
Source Host           : localhost:3306

Target Server Type    : MYSQL
Target Server Version : 50711
File Encoding         : 65001

Date: 2019-01-30 10:49:16
*/

DROP DATABASE IF EXISTS `binfast`;
CREATE DATABASE  `binfast` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

USE `binfast`;
/**
  ！！！ 以上命令是用于docker创建数据库,平时勿用！！！
  ！！！       正常从下面的开始复制            ！！！
 */
-- ----------------------------
-- Table structure for admin_function
-- ----------------------------
DROP TABLE IF EXISTS `admin_function`;
CREATE TABLE `admin_function` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `menu_id` bigint(20) DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `filter_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `page_filter` varchar(255) DEFAULT NULL,
  `is_init` int(1) DEFAULT NULL COMMENT '是否初始化该权限',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `deleted` int(1) DEFAULT NULL,
  `create_at` datetime DEFAULT NULL,
  `creator_id` bigint(20) DEFAULT NULL,
  `modify_at` datetime DEFAULT NULL,
  `modifier_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of admin_function
-- ----------------------------

-- ----------------------------
-- Table structure for admin_menu
-- ----------------------------
DROP TABLE IF EXISTS `admin_menu`;
CREATE TABLE `admin_menu` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `parent_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `code_date` varchar(100) DEFAULT NULL COMMENT '生成code日期',
  `code_num` int(10) DEFAULT NULL COMMENT '当前生成的code数',
  `prefix` varchar(100) DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `page_name` varchar(255) DEFAULT NULL,
--   `path` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
--   `redirect` varchar(255) DEFAULT NULL,
--   `component` varchar(255) DEFAULT NULL,
--   `title` varchar(255) DEFAULT NULL,
--   `icon_cls` varchar(100) DEFAULT NULL,
--   `is_hidden` int(1) DEFAULT NULL COMMENT '是否展示该业务 0：是；1否',
--   `no_cache` int(1) DEFAULT NULL,
  `level` int(20) DEFAULT NULL,
  `is_leaf` tinyint(4) DEFAULT NULL,
  `show_order` bigint(20) DEFAULT NULL,
  `is_init` int(1) DEFAULT NULL COMMENT '是否初始化',
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `deleted` int(1) DEFAULT NULL,
  `create_at` datetime DEFAULT NULL,
  `creator_id` bigint(20) DEFAULT NULL,
  `modify_at` datetime DEFAULT NULL,
  `modifier_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of admin_menu
-- ----------------------------
BEGIN;
INSERT INTO `admin_menu` VALUES ('1', '1', '0', null, null, null, '用户管理', 'WebUser', '1', '0', '1', null, null, '0', null, null, null, null);
INSERT INTO `admin_menu` VALUES ('2', '2', '1', null, null, null, '用户列表', 'WebUserList', '2', '1', '2', null, null, '0', null, null, null, null);
INSERT INTO `admin_menu` VALUES ('3', '3', '1', null, null, null, '用户详情', 'WebUserDetail', '2', '1', '3', null, null, '0', null, null, null, null);
INSERT INTO `admin_menu` VALUES ('4', '4', '0', null, null, null, '角色管理', 'Role', '1', '0', '4', null, null, '0', null, null, null, null);
INSERT INTO `admin_menu` VALUES ('5', '5', '4', null, null, null, '角色列表', 'RoleList','2', '1', '5', null, null, '0', null, null, null, null);
INSERT INTO `admin_menu` VALUES ('6', '6', '4', null, null, null, '角色详情', 'RoleDetail','2', '1', '6', null, null, '0', null, null, null, null);
COMMIT;


/**
  ！！！       Ant Design模板从下面的开始复制菜单            ！！！
  BEGIN;
  INSERT INTO `admin_menu` VALUES ('1', '1', '0', null, null, null, '权限管理', 'Auth', '1', '0', '1', null, null, '0', null, null, null, null);
  INSERT INTO `admin_menu` VALUES ('2', '2', '1', null, null, null, '用户列表', 'AdminUserList', '2', '1', '2', null, null, '0', null, null, null, null);
  INSERT INTO `admin_menu` VALUES ('3', '3', '1', null, null, null, '用户详情', 'AdminUserDetail', '2', '1', '3', null, null, '0', null, null, null, null);
  INSERT INTO `admin_menu` VALUES ('4', '4', '0', null, null, null, '角色管理', 'Role', '1', '0', '4', null, null, '0', null, null, null, null);
  INSERT INTO `admin_menu` VALUES ('5', '5', '4', null, null, null, '角色列表', 'RoleList', '2', '1', '5', null, null, '0', null, null, null, null);
  INSERT INTO `admin_menu` VALUES ('6', '6', '4', null, null, null, '角色详情', 'RoleDetail', '2', '1', '6', null, null, '0', null, null, null, null);
  INSERT INTO `admin_menu` VALUES ('7', '7', '0', null, null, null, 'dashboard', 'dashboard', '1', '0', '0', null, null, '0', null, null, null, null);
  INSERT INTO `admin_menu` VALUES ('8', '8', '7', null, null, null, '工作台', 'Workplace', '2', '1', '1', null, null, '0', null, null, null, null);
  COMMIT;
 */

-- ----------------------------
-- Table structure for admin_menu_role
-- ----------------------------
DROP TABLE IF EXISTS `admin_menu_role`;
CREATE TABLE `admin_menu_role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `admin_menu_id` bigint(20) DEFAULT NULL,
  `admin_role_id` bigint(20) DEFAULT NULL,
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `deleted` int(1) DEFAULT NULL,
  `create_at` datetime DEFAULT NULL,
  `creator_id` bigint(20) DEFAULT NULL,
  `modify_at` datetime DEFAULT NULL,
  `modifier_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of admin_menu_role
-- ----------------------------
BEGIN;
INSERT INTO `admin_menu_role` VALUES ('1', '1', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
INSERT INTO `admin_menu_role` VALUES ('2', '2', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
INSERT INTO `admin_menu_role` VALUES ('3', '3', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
INSERT INTO `admin_menu_role` VALUES ('4', '4', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
INSERT INTO `admin_menu_role` VALUES ('5', '5', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
INSERT INTO `admin_menu_role` VALUES ('6', '6', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
COMMIT;

/**
  ！！！       Ant Design模板从下面的开始复制菜单            ！！！
  BEGIN;
  INSERT INTO `admin_menu_role` VALUES ('1', '1', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
  INSERT INTO `admin_menu_role` VALUES ('2', '2', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
  INSERT INTO `admin_menu_role` VALUES ('3', '3', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
  INSERT INTO `admin_menu_role` VALUES ('4', '4', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
  INSERT INTO `admin_menu_role` VALUES ('5', '5', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
  INSERT INTO `admin_menu_role` VALUES ('6', '6', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
  INSERT INTO `admin_menu_role` VALUES ('7', '7', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
  INSERT INTO `admin_menu_role` VALUES ('8', '8', '1', null, '0', '2018-10-30 12:48:16', '1', null, null);
  COMMIT;
 */

-- ----------------------------
-- Table structure for admin_role
-- ----------------------------
DROP TABLE IF EXISTS `admin_role`;
CREATE TABLE `admin_role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `code` varchar(200) COLLATE utf8mb4_bin DEFAULT NULL,
  `name` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `menu_id` bigint(20) DEFAULT NULL,
  `available_status` int(1) DEFAULT NULL,
  `remark` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `deleted` int(1) DEFAULT NULL,
  `create_at` datetime DEFAULT NULL,
  `creator_id` bigint(20) DEFAULT NULL,
  `modify_at` datetime DEFAULT NULL,
  `modifier_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of admin_role
-- ----------------------------
BEGIN;
INSERT INTO `admin_role` VALUES ('1', null, '管理员', null, '1', '', '0', '2018-09-30 11:18:45', '1', '2018-10-30 12:48:16', '1');
COMMIT;

-- ----------------------------
-- Table structure for admin_user
-- ----------------------------
DROP TABLE IF EXISTS `admin_user`;
CREATE TABLE `admin_user` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `first_login` int(1) DEFAULT NULL,
  `username` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '登录用户名',
  `password` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '登录密码',
  `name` varchar(50) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '姓名',
  `user_type` varchar(100) COLLATE utf8mb4_bin DEFAULT NULL,
  `user_id` bigint(20) DEFAULT NULL COMMENT '关联用户',
  `is_admin` tinyint(4) DEFAULT NULL COMMENT '是否为默认管理员,超级管理员',
  `deleted` int(11) DEFAULT NULL COMMENT '逻辑删除状态',
  `create_at` datetime DEFAULT NULL COMMENT '创建时间',
  `creator_id` bigint(20) DEFAULT NULL COMMENT '创建人',
  `modify_at` datetime DEFAULT NULL COMMENT '最后修改日期',
  `modifier_id` bigint(20) DEFAULT NULL COMMENT '最后修改人',
  `department_id` bigint(20) DEFAULT NULL COMMENT '部门',
  `phone` varchar(20) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '电话',
  `email` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT '邮箱',
  `is_enable` tinyint(4) DEFAULT NULL COMMENT '状态：启用，禁用，过期',
  `join_date` datetime DEFAULT NULL,
  `duties_id` bigint(20) DEFAULT NULL,
  `remark` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL,
  `expired_date` datetime DEFAULT NULL,
  `is_temp` int(1) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `ix_username_06` (`username`) USING BTREE,
  KEY `ix_department_id_02` (`department_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

-- ----------------------------
-- Records of admin_user
-- ----------------------------
BEGIN;
INSERT INTO `admin_user` VALUES ('1', null, 'admin', '96e79218965eb72c92a549dd5a330112', '管理员', null, null, null, '0', null, null, '2019-01-30 10:45:17', '1', null, null, null, '1', null, null, null, null, null);
COMMIT;

-- ----------------------------
-- Table structure for admin_user_role
-- ----------------------------
DROP TABLE IF EXISTS `admin_user_role`;
CREATE TABLE `admin_user_role` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `admin_user_id` bigint(20) DEFAULT NULL,
  `admin_role_id` bigint(20) DEFAULT NULL,
  `remark` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL,
  `deleted` int(1) DEFAULT NULL,
  `create_at` datetime DEFAULT NULL,
  `creator_id` bigint(20) DEFAULT NULL,
  `modify_at` datetime DEFAULT NULL,
  `modifier_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

-- ----------------------------
-- Records of admin_user_role
-- ----------------------------
BEGIN;
INSERT INTO `admin_user_role` VALUES ('1', '1', '1', null, '0', '2019-01-30 10:41:54', '1', null, null);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
